tconfigfandomcom-20200213-history
How to make a new armor
How to make a new set of armor Introduction In this tutorial I will teach you how to make a new set of armor in Terraria and how to give this armor special functions. For this tutorial I assume that you already know how to make an item in Terraria and know the basics of modding with tConfig. * Tutorial length: 10-15 minutes Make the folder you need If you installed the Config Mod and made an item I assume that you know where to find your mod file and how to make a standard ModPack. In case you don't know everything yet I will still state the steps needed. *Navigate to "C:/My Documents/My Games/Terraria/". This is the folder in which the game files and saves are located. In this folder you can find the Terraria files. *Create a new folder in the ModPacks folder called "SampleArmor". Create a folder inside that called "Item" *Open the "Item" that you'll see in the Terraria root folder and copy the "Gold Greaves.ini" file, the "Gold Chainmail.ini" file and the "Gold Helmet.ini" file to your "SampleArmor/Item" folder. *Rename the files to "Sample Helmet.ini", "Sample Chainmail.ini" and "Sample Greaves.ini" so the game will note that it is a different set of armor. Make your graphics Now that we have got the main files for the armor we will need some sprites too. Unlucky for us armor sprites are very hard sprites to make since you will need to make some body part multiple times to match the character animations used in Terraria. *Take an armor .png file to start with since it's super hard to make the armor sprites without an example. In this case I suggest that you: * 1. Keep the gold armor sprites. * 2. Get the sprites used in Surfpup's Example modpack, the "Red Hero's Outfit". *When you modified them make sure that you name the different parts like you named the .ini file corresponding with it. Be sure to keep the Head, Arms, Body or Legs behind the files used for the animation or the game with not get them. Modifying the armor .ini Here is where the good stuff begins, here you'll start giving your armor your own touch. First what we're going to do is modify the "Sample Helmet.ini" file. When you open the "Sample Helmet.ini" file you'll see a bunch of variables, I will go through the most important ones and the ones you possibly want to modify. *When you open up the file the first thing that you'll notice is that the name in the brackets on top still says "Gold Helmet". You'll have to change this to the EXACT name of you file (without the .ini of course) or it will not work. For this mod we change that to "Sample Helmet". *After that you'll see the "defense" variable which tells the game how much defense this gives you. In this tutorial we'll make an armor slightly better than gold so change the "defense" variable to "5". *Right after the "defense" variable you will the the "headSlot" variable. If you are using custom graphics you should change this to "-2". If you want to keep the Gold Armor sprite you should leave it like it is right now. *Next up, the "height". Since it does the... well, height... You can keep it like it is like now so the Helmet will just keep the size of the Gold Helmet. *"maxStack', the "maxStack" variable does what it says. It shows the game how much of the item you can stack on each other. Since this is an armor part you probably want to keep this on "1". *The attribute after that is "scale", "scale" shows the game at what scale the sprites are made. You can just keep this one at 1 too. *Now comes the type. If you changed the sprites how it will appear in the inventory (the easy sprites) you need to change this to "-1" if you haven't you should keep it like it is. *the "useAnimation" shows the game that it should use the armor animation with this item, keep it like that. *You can best keep "useTime" the same too. For armor it's the best like it is. *The "value" attribute notes the value of the item in copper coins. For example: 70000 will be 70000 copper coins. We will change this to 30000 for our mod since it's slightly better. *The "width" attribute does, again, exactly what it says. You can keep this one the same too. Easy huh? Okay, now you've modified the main attributes of your armor. Now we want to make it craftable the way we want. For that we will use the last part of the file. This last part notes how you can craft the item. *First you'll see the amount, this will set how much of the item you'll get for using the recipe. We will keep this at 1 for the Helmet. *Second, you'll see the needWater this will tell the game if you need to be close to water to craft it. Just leave that one on false (unless you're planning on making some underwater type of armor). *Then come the Items, this will tell the game what is needed to craft the new type of armor (or the headpiece in this case). For this armor we'll use: Items Gold Bar=25 Silver Bar=10 Iron Bar=5 *Now the Helmet will cost 25 Gold Bars, 10 Silver Bars and 5 Iron Bars to make. *For the last one, Tiles, it tells the game what tile is used to craft the item. Since it's Anvil for all other armors we'll just keep this one at Anvil too. Well, congratulations on making your own Helmet! Now you that you made this one, take a look at the other .ini files for the Armor pieces. Those are almost exacly the same! You can use these same steps for all three of the items, when your done you'll see that it's really that easy! 'Coding your effects!' Now that you finished this you probably want to know: "But how can I make myself invisible and able to breath underwater and immune to lava when wearing this?". Well, that's the next point. You need to do that with code. First you need to make a .cs file for your armor. So you'll need a "Sample Helmet.cs" file, a "Sample Chainmail.cs" file and a "Sample Greaves.cs" file. and place those in the same directory as all your other armor files. When you have made the files you'll need to add some basic outlining, the basic outlining for effects on the wearer looks like this: public static void Effects(Player player) { } Yep, that's the very tiny standard code you'll need in your files, but it does not make your armor super awesome overpowered yet, not yet. The next thing you want to add to your file (only one of the three files, most people use the Chainmail file for that) is: public static void SetBonus(Player player) { } This tells the game what the set bonus is, like said before, only add this to ONE of your files. Most people do that in the Chainmail file. Ok, now you copy pasted those you maybe are wondering, what is the difference? Well, the difference is that the first one Effects makes an Effect even when you only wear that piece of armor and the SetBonus gives the bonus when you have the whole set equipped. For this mod we are going to give the player +1 chance on a melee crit for every piece of armor he wears and make the player invulnerable to lava when he wears the full set, we are going to do that like this. First, we have the "Sample Helmet.cs" file which currently looks like this: public static void Effects(Player player) { } To make it so that you will get an extra chance of a critical hit when melee attacking you add the following code: player.meleeCrit += 1; You can add that between the accolades in all the three files. (If you want one piece of armor to give a bigger boots you can change the += 1 in for example += 2) Now for the setboost in the "Sample Chainmail.cs" which looks like this now: public static void Effects(Player player) { player.meleeCrit += 1; } public static void SetBonus(Player player) { } We are going to add the following between the brackets of "SetBonus": player.setBonus = "Rocket Boots Effect!"; player.canRocket = true; Now that's what I call armor! It gives you +1 melee crit chance per item and gives you rocket on full set. Of course you can experiment some more with different types of attributes which can be found on the wiki! Finishing up We're almost done, we just need to test it in game! For now, make sure you save your changes to the file, and then open the game. *Click "tConfig Settings" on the main screen. *Find "SampleArmor" and change it to "on". *Restart the game with the button provided (to update the changes). *Load a world and it should show up when you're at an anvil. That's it! It's actually very simple and fast once you get the hang of it! If there are any mistakes in this tutorial please let me know and edit them out, it would be really appreciated!